package chapter14.Map;

import java.util.HashMap;
import java.util.Objects;

/**
 * @Auther: Tx
 * @Date: 2022/5/19 21:45
 */
//
public class HashMapSource02 {
    public static void main(String[] args) {
        HashMap hashMap = new HashMap();
        for (int i =1;i<= 12;i++){
            hashMap.put(new A(i),"hello");
        }
        System.out.println("hashmap="+hashMap);
    }
}
class A{
    private int num;

    public A(int num) {
        this.num = num;
    }

    @Override
    public int hashCode() {
        return 100;
    }

    @Override
    public String toString() {
        return "\n"+"A{" +
                "num=" + num +
                '}';
    }
}